home *** CD-ROM | disk | FTP | other *** search
- package de.trantor.mail.demo.j2me;
-
- import javax.microedition.lcdui.ChoiceGroup;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Form;
- import javax.microedition.lcdui.Image;
- import javax.microedition.lcdui.TextField;
-
- public class SetupScreen extends Form {
- private TextField address = new TextField("Your address:", "", 128, 1);
- private TextField hostname = new TextField("Your hostname:", "", 128, 4);
- String[] names = new String[]{"POP3", "IMAP"};
- private ChoiceGroup services;
- private TextField pop3Host;
- private TextField pop3User;
- private TextField pop3Pass;
- private TextField smtpHost;
- String[] options;
- private ChoiceGroup debug;
- // $FF: renamed from: OK javax.microedition.lcdui.Command
- public static Command field_0 = new Command("Ok", 1, 1);
-
- public SetupScreen(MailMIDlet midlet) {
- super("Setup");
- this.services = new ChoiceGroup("Inbox type:", 1, this.names, (Image[])null);
- this.pop3Host = new TextField("Inbox hostname:", "", 128, 4);
- this.pop3User = new TextField("Inbox username:", "", 128, 0);
- this.pop3Pass = new TextField("Inbox password:", "", 128, 65536);
- this.smtpHost = new TextField("SMTP hostname:", "", 128, 4);
- this.options = new String[]{"Off", "On"};
- this.debug = new ChoiceGroup("Debugging:", 1, this.options, (Image[])null);
- ((Form)this).append(this.address);
- ((Form)this).append(this.hostname);
- ((Form)this).append(this.services);
- ((Form)this).append(this.pop3Host);
- ((Form)this).append(this.pop3User);
- ((Form)this).append(this.pop3Pass);
- ((Form)this).append(this.smtpHost);
- ((Form)this).append(this.debug);
- ((Displayable)this).addCommand(field_0);
- ((Displayable)this).setCommandListener(midlet);
- }
-
- public String getAddress() {
- return this.address.getString();
- }
-
- public String getHostname() {
- return this.hostname.getString();
- }
-
- public boolean getImap() {
- return this.services.isSelected(1);
- }
-
- public String getPop3Host() {
- return this.pop3Host.getString();
- }
-
- public String getPop3User() {
- return this.pop3User.getString();
- }
-
- public String getPop3Pass() {
- return this.pop3Pass.getString();
- }
-
- public boolean getDebug() {
- return this.debug.isSelected(1);
- }
-
- public String getSmtpHost() {
- return this.smtpHost.getString();
- }
-
- public void setAddress(String address) {
- this.address.setString(address);
- }
-
- public void setHostname(String hostname) {
- this.hostname.setString(hostname);
- }
-
- public void setImap(boolean value) {
- if (value) {
- this.services.setSelectedIndex(1, true);
- }
-
- }
-
- public void setPop3Host(String pop3Host) {
- this.pop3Host.setString(pop3Host);
- }
-
- public void setPop3User(String pop3User) {
- this.pop3User.setString(pop3User);
- }
-
- public void setPop3Pass(String pop3Pass) {
- this.pop3Pass.setString(pop3Pass);
- }
-
- public void setSmtpHost(String smtpHost) {
- this.smtpHost.setString(smtpHost);
- }
-
- public void setDebug(boolean value) {
- if (value) {
- this.debug.setSelectedIndex(1, true);
- }
-
- }
- }
-